from django.contrib.admin import AdminSite
from django.contrib.auth.admin import GroupAdmin
from django.contrib.auth.models import Group
from rest_framework.authtoken.models import Token

from app.admin.area_admin import AreaAdmin
from app.admin.banner_admin import BannerAdmin
from app.admin.cart_admin import CartAdmin
from app.admin.category_admin import CategoryAdmin
from app.admin.common_product_admin import CommonProductAdmin
from app.admin.feed_back_admin import FeedBackAdmin
from app.admin.fm_user_admin import FMUserAdmin, UserAccountAdmin
from app.admin.hot_keyword_admin import HotKeywordAdmin
from app.admin.invitation_code_admin import InvitationCodeAdmin
from app.admin.mailing_address_admin import MailingAddressAdmin
from app.admin.order_admin import OrderAdmin
from app.admin.pay_method_admin import PayMethodAdmin
from app.admin.product_admin import ProductAdmin, ProductSpecAdmin, ProductDetailImageAdmin
from app.admin.wish_product_admin import WishProductAdmin
from app.models import Category, Product, Order, ProductSpec, Cart, ProductDetailImage, WishProduct
from app.models import FMUser
from app.models.address import MailingAddress
from app.models.area import Area
from app.models.banner import Banner
from app.models.common_product import CommonProduct
from app.models.feedback import FeedBack
from app.models.hot_keyword import HotKeyword
from app.models.invitation_code import InvitationCode
from app.models.pay_method import PayMethod


class FMAdminSite(AdminSite):
    site_header = u'华焱管理后台'
    site_title = u'数据管理'


admin_site = FMAdminSite(name='fmadmin')

admin_site.register(FMUser, FMUserAdmin)
# admin.site.register(UserAccount, UserAccountAdmin)
admin_site.register(InvitationCode, InvitationCodeAdmin)

admin_site.register(Category, CategoryAdmin)
admin_site.register(Order, OrderAdmin)
admin_site.register(Product, ProductAdmin)
admin_site.register(ProductSpec, ProductSpecAdmin)
admin_site.register(ProductDetailImage, ProductDetailImageAdmin)
admin_site.register(MailingAddress, MailingAddressAdmin)
admin_site.register(Cart, CartAdmin)
admin_site.register(Area, AreaAdmin)
admin_site.register(PayMethod, PayMethodAdmin)
admin_site.register(HotKeyword, HotKeywordAdmin)
admin_site.register(Banner, BannerAdmin)
admin_site.register(FeedBack, FeedBackAdmin)
admin_site.register(CommonProduct, CommonProductAdmin)
admin_site.register(WishProduct, WishProductAdmin)

admin_site.register(Token)
admin_site.register(Group, GroupAdmin)
